<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>
    <div class="div-info-body person_info">
      <div class="right">
	<a href="/users/baseinfo_history?userid=<%$user.id%>">历史记录</a>
      </div>
      <form id="register" action="/users/update" method='post' class="app-people">
	<input type="hidden" name="userid" value="<%$user.id%>"/>

          <section id="address">
            <dt>
	      省：
	    </dt>
            <dd>
	      <select required class="required" id="province_id">
		<%$provinces%>
	      </select>
	    </dd>
            <dt>
	      市：
	    </dt>
            <dd>
	      <select required1 class="required1" id="city_id">
		<%$cities%>
	      </select>
	    </dd>
            <dt>
	      县：
	    </dt>
            <dd>
	      <select required1 class="1required" id="town_id">
		<%$towns%>
	      </select>
              <input name="region_code" type="hidden" id="city_code" value="<%$user.region_code%>"/>
	    </dd>
	  </section>
          <section id="name">
            <dt>
	      性别：
	    </dt>
            <dd>	
	      <label><input type="radio" required class="required" name="gender" id="male" value="<%$MALE%>" <% if $user.gender eq $male %>checked<%/if%>/>男</label>
	      <label><input type="radio" name="gender" id="female" value="<%$FEMALE%>" <% if $user.gender eq $female %>checked<%/if%>/>女</label>            
	    </dd>
	    
            <dt>
	      姓：
	    </dt>
	    <dd>
	      <input required class="required" maxlength="8" type="text" name="first_name" value="<%$user.first_name%>"/>
	    </dd>
	    <dt>名：</dt>
	    <dd><input required class="required" maxlength="8" type="text" name="name" value="<%$user.name%>"/></dd>
	    <dt>字：</dt>
	    <dd><input class="required" maxlength="16" type="text" name="symbol" value="<%$user.symbol%>"/></dd>
	    <dt>号/称谓：</dt>
	    <dd><input class="required" maxlength="16" type="text" name="title" value="<%$user.title%>"/></dd>
            <dt>
	      出生日期：
	    </dt>
	    <dd>
	      <input required1 1pattern="-?\d{1,4}(-(0[1-9]|1[0-2]))?(-(0[1-9]|1[0-9]|2[0-9]|3[0-1]))?" 
		     class="required1" maxlength="11" type="text" name='day_of_birth' value="<%$user.day_of_birth%>"/>
	    </dd>
          </section>
          <section id="relation">
	  <dt>
	    开放：
	  </dt>
	  <dd>
	    <%if $open|@count gt 0%>
	    <%foreach from=$open key=k item=v%>		
	    <label><input type="radio" required class="required" name="open" id="<%$k%>" value="<%$k%>" 
			  <% if (!$user.open && $k eq "public") || $user.open eq $k %>checked<%/if%> 
			  /><%$v%></label>
	    <%/foreach%>
	    <%/if%>
	  </dd>
          </section>

	</div>
	<div class="div-form-line">
	  <div class="div-form-label">&nbsp;
	  </div>
	  <div class="div-form-input">
            <input type="submit" value="保存"/>
	  </div>
	</div>
      </form>
    </div>
    <div class="clear"></div>
  </div>
  <div class="clear"></div>
</div>
<%include file="include/bottom.html"%>  
